<?
class ApiController extends AppController {

	var $name = 'Api';
	var $uses = array('Category');

	var $helpers = array('Xml');

	function beforeFilter() {
		parent::beforeFilter();

		$this->Auth->allow('*');

		$this->layout = 'api';

		//pr($this->params);

		if (isset($this->params['url']['api_key'])) {

		} else {
			$this->render('invalid_key');
		}

		Configure::write('debug', 1);

		$this->RequestHandler->respondAs('xml');

	}

	function test() {

	}

	function categories() {
		$this->set('data', $this->Category->find('all'));
		$this->render('data');
	}

}
?>